package com.zcxy.edu.service.impl;

import java.util.List;
import com.zcxy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zcxy.edu.mapper.EduTeacherSmsConfigMapper;
import com.zcxy.edu.domain.EduTeacherSmsConfig;
import com.zcxy.edu.service.IEduTeacherSmsConfigService;

/**
 * 短信配置Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-24
 */
@Service
public class EduTeacherSmsConfigServiceImpl implements IEduTeacherSmsConfigService
{
    @Autowired
    private EduTeacherSmsConfigMapper eduTeacherSmsConfigMapper;

    /**
     * 查询短信配置
     *
     * @param id 短信配置主键
     * @return 短信配置
     */
    @Override
    public EduTeacherSmsConfig selectEduTeacherSmsConfigById(Long id)
    {
        return eduTeacherSmsConfigMapper.selectEduTeacherSmsConfigById(id);
    }

    /**
     * 查询短信配置列表
     *
     * @param eduTeacherSmsConfig 短信配置
     * @return 短信配置
     */
    @Override
    public List<EduTeacherSmsConfig> selectEduTeacherSmsConfigList(EduTeacherSmsConfig eduTeacherSmsConfig)
    {
        return eduTeacherSmsConfigMapper.selectEduTeacherSmsConfigList(eduTeacherSmsConfig);
    }

    /**
     * 新增短信配置
     *
     * @param eduTeacherSmsConfig 短信配置
     * @return 结果
     */
    @Override
    public int insertEduTeacherSmsConfig(EduTeacherSmsConfig eduTeacherSmsConfig)
    {
        eduTeacherSmsConfig.setCreateTime(DateUtils.getNowDate());
        return eduTeacherSmsConfigMapper.insertEduTeacherSmsConfig(eduTeacherSmsConfig);
    }

    /**
     * 修改短信配置
     *
     * @param eduTeacherSmsConfig 短信配置
     * @return 结果
     */
    @Override
    public int updateEduTeacherSmsConfig(EduTeacherSmsConfig eduTeacherSmsConfig)
    {
        eduTeacherSmsConfig.setUpdateTime(DateUtils.getNowDate());
        return eduTeacherSmsConfigMapper.updateEduTeacherSmsConfig(eduTeacherSmsConfig);
    }

    /**
     * 批量删除短信配置
     *
     * @param ids 需要删除的短信配置主键
     * @return 结果
     */
    @Override
    public int deleteEduTeacherSmsConfigByIds(Long[] ids)
    {
        return eduTeacherSmsConfigMapper.deleteEduTeacherSmsConfigByIds(ids);
    }

    /**
     * 删除短信配置信息
     *
     * @param id 短信配置主键
     * @return 结果
     */
    @Override
    public int deleteEduTeacherSmsConfigById(Long id)
    {
        return eduTeacherSmsConfigMapper.deleteEduTeacherSmsConfigById(id);
    }

    /**
     * 根据类型获取配置短信
     * @param type
     * @return
     */
    public EduTeacherSmsConfig selectEduTeacherSmsConfigByType(String type){
        return eduTeacherSmsConfigMapper.selectEduTeacherSmsConfigByType(type);
    }
}
